﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FaceComp : MonoBehaviour
{
    public Transform m_Target;

    void Start()
    {

    }

    void LateUpdate()
    {
        if (m_Target != null)
        {
            var pos = m_Target.position;
            pos.y = this.transform.position.y;
            this.transform.LookAt(pos);
        }
        else
        {
            var p = Client.Instance.GetLocalPlayer();
            //m_Target = p == null ? null : p.transform;
            m_Target = Camera.main.transform;
        }
    }
}
